package com.m4f.business.model;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class Video implements Serializable {
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

	@Persistent
	private String youTubeId;
	
	@Persistent
	private Company company;
	
	@Persistent
	private String thumbURL;
	
	@Persistent
	private Boolean available;
	
	@Persistent
	private String reason = "";
	
	@Persistent
	private Long contentLenght;
	
	@Persistent
	private Long duration;
	
	@Persistent
	private Date uploaded;
	
	public Key getKey() {
		return this.key;
	}
	
	public void setYouTubeId(String yTId) {
		this.youTubeId = yTId;
	}
	
	public String getYouTubeId() {
		return this.youTubeId;
	}
	
	public Company getCompany() {
		return this.company;
	}
	
	public void setCompany(Company comp) {
		this.company = comp;
	}

	public void setThumbURL(String thumbURL) {
		this.thumbURL = thumbURL;
	}

	public String getThumbURL() {
		return thumbURL;
	}

	public void setAvailable(Boolean available) {
		this.available = available;
	}

	public boolean isAvailable() {
		return available==null?true:this.available;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getReason() {
		return reason;
	}

	public void setContentLenght(Long contentLenght) {
		this.contentLenght = contentLenght;
	}

	public Long getContentLenght() {
		return contentLenght;
	}

	public void setDuration(Long duration) {
		this.duration = duration;
	}

	public Long getDuration() {
		return duration;
	}

	public void setUploaded(Date uploaded) {
		this.uploaded = uploaded;
	}

	public Date getUploaded() {
		return uploaded;
	}

	
}